package com.xuecheng.controller;

import com.xuecheng.constant.MysqlConstant;
import com.xuecheng.service.CourseCategoryService;
import com.xuecheng.vo.CourseCategoryTreeVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 课程分类
 */
@Slf4j
@RestController("CourseCategoryController")
@RequestMapping("/course-category")
@Api(value = "课程分类信息", tags = "课程分类")
public class CourseCategoryController {
	
	@Resource
	private CourseCategoryService courseCategoryService;
	
	/**
	 * 根据id查询分类
	 */
	@GetMapping("/tree-nodes")
	public List<CourseCategoryTreeVO> queryTreeNodes() {
		log.info("根据查询分类：{}", MysqlConstant.COURSE_CATEGORY_ID);
		return courseCategoryService.queryTreeNodes();
	}
}
